AjaxSolr.ResultWidget = AjaxSolr.AbstractWidget.extend({
    afterRequest: function() {
        console.log("SOLR-DOJO: response count",this.manager.response.response.docs.length);
        dojo.query("#" + this.target).empty();
        console.log("SOLR-DOJO: Target emptied");
        //dojo.query('#' + this.target).place('<input type=checkbox checked=""/>', "last");
        //console.log("SOLR-DOJO: input type placed in target");
        console.log("SOLR-DOJO: looping over results");
        wm.Page.getPage("Main").textNumberOfSearchResults.setDisplayValue(this.manager.response.response.docs.length);
        for (var i = 0, l = this.manager.response.response.docs.length; i < l; i++) {

            var doc = this.manager.response.response.docs[i];
            //dojo.query(this.target).append(AjaxSolr.theme('result', doc, AjaxSolr.theme('snippet', doc)));
            dojo.place(AjaxSolr.theme('result', doc, AjaxSolr.theme('snippet', doc)), this.target, "last");
        }
    }
})
;
